package org.explugin;

import com.intellij.lang.Language;
import com.intellij.openapi.fileTypes.LanguageFileType;
import com.intellij.openapi.util.IconLoader;
import org.explugin.lang.ExLanguage;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

public class ExFileType extends LanguageFileType {

    private static final ExFileType instance = new ExFileType(ExLanguage.getInstance());

    private ExFileType(@NotNull Language language) {
        super(language);
    }

    public static ExFileType getInstance() {
        return instance;
    }

    @NotNull
    @Override
    public String getName() {
        return ExBundle.message("explugin.filetype");
    }

    @NotNull
    @Override
    public String getDescription() {
        return ExBundle.message("explugin.description");
    }

    @NotNull
    @Override
    public String getDefaultExtension() {
        return "ex";
    }

    @Override
    public Icon getIcon() {
        return IconLoader.findIcon("/org/explugin/resources/icon.png");
    }
}
